package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Travel;
import cn.wolfcode.trip.base.domain.User;
import cn.wolfcode.trip.base.query.CollectQueryObject;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.SearchQueryObject;
import cn.wolfcode.trip.base.query.TravelQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TravelMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Travel entity);

    Travel selectByPrimaryKey(Long id);

    List<Travel> selectAll();

    int updateByPrimaryKey(Travel entity);

    List<Travel> selectForList(TravelQueryObject qo);

    void changeStatus(Travel travel);

    /**
     * 根据关键字查询该游记的总数
     * @param keyword
     * @return
     */
    int selectCountByKeyword(String keyword);

    /**
     * 通过关键字查询游记
     * @param qo
     * @return
     */
    List<Travel> selectByKeyword(SearchQueryObject qo);

    /**
     * 查询用户收藏的游记
     * @param qo
     * @return
     */
    List<Travel> selectForCollect(CollectQueryObject qo);

    /**
     * 获取该用户被点赞的未读游记
     * @param qo
     * @return
     */
    List<Map<String,Object>> selectTravelForDoGood(TravelQueryObject qo);
}